<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Document</title>
    <script src="../js/vue2.js"></script>
  </head>
  <body>
    <div id="app">
     <!-- 用户名: <input type="text"  v-model="useForm.username" @input="getValue"/> -->
     <input type="text"  v-model='useForm.username' >
     <input type="button" value="+">
     <input type="text" v-model='useForm.password'>
     <input type="button"  @click='getAll' > 
     <input type="text" v-model = 'count'>
    </div>
  </body>

  <script>
    var bon = new Vue({
      //   插入模块,指定只能在摸个选择器中使用
      el: "#app",
      data: {
        useForm: {
          username: "3",
          password: "8"
        },
        count: ''
      },
      methods: {
       getAll(){
        this.count = Number(this.useForm.username) +Number( this.useForm.password)
       }
      }
    });
  </script>
</html>
